import requests
import execjs

cookies = {
    'Hm_lvt_2610e5c202b60841b30a62960fbef0ad': '1700190675',
    'PI': '44',
    'Hm_lpvt_2610e5c202b60841b30a62960fbef0ad': '1700190680',
}

headers = {
    'authority': 'www.jizhy.com',
    'accept': 'application/json, text/plain, */*',
    'accept-language': 'zh-CN,zh;q=0.9',
    'cache-control': 'no-cache',
    # 'cookie': 'Hm_lvt_2610e5c202b60841b30a62960fbef0ad=1700190675; PI=44; Hm_lpvt_2610e5c202b60841b30a62960fbef0ad=1700190680',
    'pragma': 'no-cache',
    'referer': 'https://www.jizhy.com/44/search?searchVal=%E7%9B%8A%E9%98%B32',
    'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'same-origin',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
}

params = execjs.compile(open('逆向JS.js','r',encoding='utf-8').read()).call("decrypt_data","上海")

response = requests.get('https://www.jizhy.com/searchcenter/search', params=params, cookies=cookies, headers=headers)

for item in response.json()['data']['sch_list']:
    print(item)